<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return CMap::mergeArray(
	require_once dirname(__FILE__).'/params.php',
	array(
	'basePath'=>dirname(__FILE__).DS.'..',
	'name'=>'::Delivery::',
	'theme'=>'delivery',
	'defaultController'=>'default',
	// preloading 'log' component
	'preload'=>array('log'),
	// autoloading model and component classes
	'import'=>array(
		'frontend.models.*',
		'frontend.components.*',
		'frontend.widgets.*',
		'frontend.extensions.*',
		'frontend.extensions.uploadify.*',
		'frontend.extensions.image.*',
		'common.helpers.*',
		'frontend.helpers.*',
		'frontend.portlets.ShoppingCart.*',
		'frontend.portlets.Counter.*',
		'frontend.portlets.LastestNews.*',
		'frontend.widgets.support.*',
		'frontend.vendors.easymap.*',
		'frontend.vendors.EGMap.*',
	),
	'behaviors' => array('FrontendConfigBehavior'),
	'modules'=>array(
		'user',
		// uncomment the following to enable the Gii tool
		/*
		'gii'=>array(
			'class'=>'system.gii.GiiModule',
			'password'=>'Enter Your Password Here',
			// If removed, Gii defaults to localhost only. Edit carefully to taste.
			'ipFilters'=>array('127.0.0.1','::1'),
		),
		*/
	),

	// application components
	'components'=>array(
		'user'=>array(
			// enable cookie-based authentication
			'class' => 'WebUser',
			'allowAutoLogin'=>true,
			'loginUrl' => array('/user/login'),
		),
		'image'=>array(
				'class'=>'ext.image.CImageComponent',
				// GD or ImageMagick
				'driver'=>'GD',
				// ImageMagick setup path
				'params'=>array('directory'=>'/opt/local/bin'),
		),
		// uncomment the following to enable URLs in path-format
		
		'urlManager'=>array(
			'urlFormat'=>'path',
			'rules'=>array(
				''	=>	'default/index',
				'<action:(login|logout|about|contact|home|news)>' => 'default/<action>',
				'<alias>'=>'default/page',
				'hoi-dap/<id:\d+>_<alias>'=>'ask/detail',
				'<cat>/<alias>-<year:\d{4}><month:\d{2}><id>'=>'post/read',
				'<controller:\w+>/<action:\w+>/<id:\d+>_<alias>'=>'<controller>/<action>',
				'<controller:\w+>/<id:\d+>'=>'<controller>/view',
				'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
				'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
				'<module:\w+>/<controller:\w+>/<action:\w+>'=>'<module>/<controller>/<action>',
			),
			'urlSuffix'		=>	'.html',
			'showScriptName'=>false,
		),
		
		
		/* 'errorHandler'=>array(
			// use 'site/error' action to display errors
			'errorAction'=>'site/error',
		), */
		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning',
				),
				// uncomment the following to show log messages on web pages
				
				array(
					'class'=>'CWebLogRoute',
				),
				
			),
		),
	),

	// application-level parameters that can be accessed
)
);